package com.kirk.cts.core.runcycle.schedule.processor.support;

import com.kirk.cts.core.init.InitServiceManager;
import com.kirk.cts.core.runcycle.schedule.processor.IRunScheduleProcessor;
import com.kirk.cts.core.runcycle.schedule.Schedule;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * <p> InitScheduleProcessor.java </p>
 *
 * @version 1.0.0
 * @Author kirkliu
 * @Date 2020-08-30 16:37
 * @Description 初始化任务
 */
@Component("initScheduleProcessor")
public class InitScheduleProcessor extends AbstractScheduleProcessor implements IRunScheduleProcessor {

    @Resource(name = "initServiceManager")
    private InitServiceManager initServiceManager;

    @Override
    public int getIndex() {
        return 2;
    }


    @Override
    protected void doExecute(Schedule schedule) {
        initServiceManager.run();
    }


    @Override
    protected boolean isNewThread() {
        return false;
    }

}
